namespace NavigateExample.Services.Navigation
{
    /// <summary>
    /// 导航感知接口，ViewModel实现此接口可以接收导航参数
    /// </summary>
    public interface INavigationAware
    {
        /// <summary>
        /// 当导航到此ViewModel时调用
        /// </summary>
        /// <param name="parameters">导航参数</param>
        void OnNavigatedTo(NavigationParameters parameters);

        /// <summary>
        /// 当从此ViewModel导航离开时调用
        /// </summary>
        /// <param name="parameters">导航参数</param>
        void OnNavigatedFrom(NavigationParameters parameters);

        /// <summary>
        /// 检查是否可以导航离开此ViewModel
        /// </summary>
        /// <param name="parameters">导航参数</param>
        /// <returns>是否允许导航离开</returns>
        bool CanNavigateFrom(NavigationParameters parameters);
    }
}